public class Person {

    public String name;
    private int id;

    public Person() {
    }
    public Person(String name, int id) {
        this.name = name;
        this.id = id;
    }

    public String getName() {
        return name;
    }
    public int getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void eat(){
        System.out.println("Person类中不带参数的eat方法");
    }
    public void eat(String s){
        System.out.println("Person类带String参数的eat方法");
    }

    public String eat(String s, int i){
        System.out.println("Person类带String参数和int参数的eat方法");
        return s;
    }
    private String privateEat(String s){
        System.out.println("民以食为天");
        return s;
    }
    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", id=" + id +
                '}';
    }
}
